<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Route::group([
    'as' => config('department.route.prefix') . '.',
], function (Router $router) {
    $router->get('/', 'HomeController@index');

    $router->get('patent-lib', 'PatentLibraryController@index');
    $router->resource('users', 'UserController');

    $router->get('patents', 'PatentApplyController@publish');

    $router->get('transactions', 'PatentTransactionController@index');

    $router->resource('bookApplies', 'BookApplyController');

    $router->resource('plantVarieties', 'PlantVarietyController');

    $router->resource('documents', 'DocumentController')->only(['index','destroy']);

    $router->resource('transverses', 'TransverseController');
    $router->get('transverseTj', 'TransverseTjController@index');

    //专利申请登记
    $router->group(['prefix' => 'patent', 'as' => 'patent.'], function (\Illuminate\Routing\Router $router) {
        //申请前登记
        $router->resource('applies', 'PatentApplyController');
//        $router->get('pg/download/{id}', 'PatentApplyController@download')->name('pg.download');
//        $router->get('pg/preview/{id}', 'PatentApplyController@preview')->name('pg.preview');
        $router->get('publish', 'PatentApplyController@publish')->name('publish');
        $router->get('fees', 'PatentFeeController@index')->name('fees.index');
    });
    $router->group([], function ($router) {
        $router->namespace('\Encore\Admin\Controllers')->group(function ($router) {
//            $router->post('_handle_form_', 'HandleController@handleForm')->name('admin.handle-form');
//            $router->post('_handle_action_', 'HandleController@handleAction')->name('admin.handle-action');
//            $router->get('_handle_selectable_', 'HandleController@handleSelectable')->name('admin.handle-selectable');
            $router->get('_handle_renderable_', 'HandleController@handleRenderable')->name('handle-renderable');
        });
    });
    require dirname(__DIR__, 2) . '/routes/file.php';

});

